/*
 ============================================================================
 Name		: SoundPlayer.h
 Author	  : 
 Version	 : 1.0
 Copyright   : Your copyright notice
 Description : CSoundPlayer declaration
 ============================================================================
 */

#ifndef SOUNDPLAYER_H
#define SOUNDPLAYER_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>

// CLASS DECLARATION

/**
 *  CSoundPlayer
 * 
 */
#include <MdaAudioSamplePlayer.h>

class CSoundPlayer: public CBase, public MMdaAudioPlayerCallback
{
public:
   static CSoundPlayer* NewL(const TDesC& aFile);
   static CSoundPlayer* NewLC(const TDesC& aFile);
   ~CSoundPlayer();
   void PlayL();
   void StopL();

   //
   // from MMdaAudioPlayerCallback
   //
   void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
   void MapcPlayComplete(TInt aError);

private:
   CSoundPlayer();
   void ConstructL(const TDesC& aFile);

private:
   enum TState
   {
       ENotReady,
       EReady,
       EPlaying
   };

   TState iState;
   CMdaAudioPlayerUtility* iMdaPlayer;
};
#endif // SOUNDPLAYER_H
